<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml" xmlns:v-for="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
</head>

<!--本小节知识点：-->
<!--1 v-model-->
<!--2 v-for-->
<!--3 v-on:click-->
<!--4 methods-->


<body >
<div id="app">
<input type="text" v-model="inputVal">
<button v-on:click="pushText">提交</button>
<ul>
    <li v-for="item in content">{{item}}</li>
</ul>
</div>
<script>
    var vue=new Vue({
        el:'#app',
        data:{
            content:[]
        },methods:{
            pushText:function () {
            this.$data.content.push(this.inputVal);
            this.inputVal=""
            }
        }
    })

</script>
</body>
</html>